home *** CD-ROM | disk | FTP | other *** search
- 10 'RECONCIL.BAS - Program to aid in reconciling our checking account file
- 20 'From the GWBASIC Tutorial Series (GWBT07, December 1990)
- 30 'First task - assign storage for uncleared checks, by number and amount...
- 40 DIM CHECKNUMBER(50),CHECKAMOUNT(50)
- 50 'These arrays will be used to store the number and amount of all checks that
- 60 'have not cleared the bank (been cashed) yet.
- 70 'Next step is to open the CHECKS.DAT file, read in checks and see if they
- 80 'show as cleared on the statement...
- 90 CLS:KEY OFF
- 100 OPEN "CHECKS.DAT" FOR INPUT AS #1
- 110 WHILE NOT EOF(1)
- 120 LINE INPUT #1,CHECKDATA$
- 130 'Remember our list of data locations in each record, now extract the needed
- 140 'information to decide if a check has cleared yet...
- 150 CHECKNO=VAL(LEFT$(CHECKDATA$,6))
- 160 CHECKAMOUNT=VAL(MID$(CHECKDATA$,67,6))
- 170 'Print check number and amount on screen so user can decide if it has been
- 180 'cashed or not..
- 190 LOCATE 10,1,0
- 200 PRINT USING "CHECK NUMBER: ###### CHECK AMOUNT: $$#####.##";CHECKNO,CHECKAMOUNT
- 210 LOCATE 15,1,0
- 220 INPUT "Has this check cleared the bank? <Y>es or <N>o",CLEARED$
- 230 'The user might enter just the letter 'y', or a capital 'Y', or maybe the
- 240 'words 'Yes' or 'yes', so we need to figure out a way to be sure. Let's
- 250 'take the LEFT character, which should either be 'y' or 'Y' either way...
- 260 CLEARED$=LEFT$(CLEARED$,1)
- 270 'Now see if it's a 'y' and if so, skip to next check...
- 280 IF CLEARED$="Y" OR CLEARED$="y" THEN GOTO 350
- 290 'If check has not cleared, put it in the array after adding one to the
- 300 'counter...
- 310 COUNTER=COUNTER+1
- 320 CHECKNO(COUNTER)=CHECKNO
- 330 CHECKAMOUNT(COUNTER)=CHECKAMOUT
- 340 'Whether cleared or not, go on to next check in file...
- 350 WEND
- 360 CLS
- 370 PRINT "I need a little more information to reconcile your checking account."
- 380 PRINT "Please provide the following information..."
- 390 PRINT
- 400 PRINT "What is the current balance in your checkbook",CHECKBOOKBALANCE
- 410 PRINT "What service fees need to be deducted",SERVICEFEES
- 420 PRINT "What is the current balance on your statement",STATEMENTBALANCE
- 430 PRINT "Working..."
- 440 'First, deduct outstanding checks from statement balance
- 450 FOR N=1 TO COUNTER
- 460 STATEMENTBALANCE=STATEMENTBALANCE-CHECKAMOUNT(N)
- 470 NEXT N
- 480 'Next, deduct service fees from the checkbook balance
- 490 CHECKBOOKBALANCE=CHECKBOOKBALANCE-SERVICEFEES
- 500 'Finally, the checkbook and statement balances should agree...
- 510 PRINT "Reconciliation complete! Final balances are as follows:"
- 520 PRINT USING "Balance in Checkbook Register: $$#####.##";CHECKBOOKBALANCE
- 530 PRINT USING "Reconciled Statement Balance : $$#####.##";STATEMENTBALANCE
- 540 PRINT
- 550 PRINT "The two amounts above should agree. If they do not, you need to"
- 560 PRINT "re-check your work and try again..."
- 570 PRINT
- 580 PRINT "Press any key to end program
- 590 WHILE INKEY$=":wend
- 600 CLOSE
- 610 RESET
- 620 END
- 630 'End of program - RECONCIL.BAS